package com.anlu.base.jdk.jdk8;

import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.function.Function;

public class FunctionTest2 {
    private final Logger logger = LoggerFactory.getLogger(getClass());



    @Test
    void test1(){
        Function<String,String> functionUpper = str -> str.toUpperCase();

        Function<String, List<String>> funToList = str -> List.of(str.split(","));

        String str1 = "wer";
        str1 = functionUpper.apply(str1);
        logger.info(str1);


        String str2 = "wo,men,shi,zhongguo,ren ";
        List<String> list = funToList.apply(str2);
        list.stream().forEach(System.out::println);

    }
}
